# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=xprobe2
pkgver=0.3
pkgrel=8
groups=('blackarch' 'blackarch-fingerprint')
pkgdesc='An active OS fingerprinting tool.'
url='http://sourceforge.net/apps/mediawiki/xprobe/index.php?title=Main_Page'
arch=('x86_64' 'aarch64')
license=('GPL2')
depends=('gcc' 'libpcap')
source=("http://downloads.sourceforge.net/project/xprobe/xprobe2/Xprobe2%200.3/xprobe2-$pkgver.tar.gz"
        'ip.patch'
        'misc.patch'
        'tcp.patch')
sha512sums=('fd499ada22be5df3e01630948cb72d1a9e648e0c7bfaf2a688386a61c67bb36a326a9e2f3f2b9960a6a49128343010aafe8a3f04ec05e89420a1384215e41f21'
            '31cb4e9a51a3a425ad76e12fcfa5ec84f5ff2804ed2f6a863c2b1c69067202120e092180576f25e9fd8b20a9d7a5f1681d5629c4953bcd96b70775cd6f56f447'
            '854f1cfa7ff73ad1f52dd1f9304fe417dbb30cf0b350b034420280267c2ced6b87aec363c2941b41f3317f41bc1b9ebf584f4cac9ffd24e2d088d45e3734ce28'
            '41039d306e99844127958b66e254cabca3adb505baab25935bb163661074b5a2b45449cb6007ced51499c99ee8e34dd6dc03acbba708f0df8f8be6a9e1ed97ef')

build() {
  cd "$pkgname-$pkgver"

  patch -p1 < $srcdir/ip.patch
  patch -p1 < $srcdir/misc.patch
  patch -p1 < $srcdir/tcp.patch

  if [[ "$CARCH" == "i686" || "$CARCH" == "x86_64" ]];
  then
    ./configure --prefix=/usr --sysconfdir=/etc
  else
    ./configure --build=arm --prefix=/usr --sysconfdir=/etc
  fi

  make
}

package() {
  cd "$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install
}

